#pragma once



	/*
	typedef enum pro_value_data_type
	{
		PRO_VALUE_TYPE_INT           = 1,
		PRO_VALUE_TYPE_DOUBLE,
		PRO_VALUE_TYPE_POINTER,
		PRO_VALUE_TYPE_STRING,
		PRO_VALUE_TYPE_WSTRING,
		PRO_VALUE_TYPE_SELECTION,
		PRO_VALUE_TYPE_TRANSFORM,
		PRO_VALUE_TYPE_BOOLEAN
	} ProValueDataType;
	 */
 /*
typedef enum elem_value_data_type
{
	ELEM_VALUE_TYPE_INT           = 1,
	ELEM_VALUE_TYPE_DOUBLE,
	ELEM_VALUE_TYPE_POINTER,
	ELEM_VALUE_TYPE_STRING,
	ELEM_VALUE_TYPE_WSTRING,
	ELEM_VALUE_TYPE_SELECTION,
	ELEM_VALUE_TYPE_TRANSFORM,
	ELEM_VALUE_TYPE_BOOLEAN,
	ELEM_VALUE_TYPE_COLLECTION
} UtilElemType;
 */

namespace witotk{

namespace ev{
	
	typedef enum elem_value_data_type_w
	{
		ELEM_VALUE_TYPE_INT           = 1,
		ELEM_VALUE_TYPE_DOUBLE,
		ELEM_VALUE_TYPE_POINTER,
		ELEM_VALUE_TYPE_STRING,
		ELEM_VALUE_TYPE_WSTRING,
		ELEM_VALUE_TYPE_SELECTION,
		ELEM_VALUE_TYPE_TRANSFORM,
		ELEM_VALUE_TYPE_BOOLEAN,
		ELEM_VALUE_TYPE_COLLECTION
	} ElemValueType;

	  template<ProElemId id,ElemValueType vt>
	  struct ProElemIdType
	  {
		  static const ProElemId value = id;
	  };


	  typedef ProElemIdType<PRO_E_FEATURE_TYPE,ELEM_VALUE_TYPE_INT> PRO_E_FEATURE_TYPE_T;
	  PRO_E_FEATURE_TYPE_T wFEATURE_TYPE;
	  typedef ProElemIdType<PRO_E_STD_FEATURE_NAME,ELEM_VALUE_TYPE_WSTRING> PRO_E_STD_FEATURE_NAME_T;
	  PRO_E_STD_FEATURE_NAME_T 	STD_FEATURE_NAME;



	  class PV_T_item;
	  template<ElemValueType VT>	 class PV_T ;
	  
	  class PV
	  {
	  public:
		  //PV_T<ELEM_VALUE_TYPE_INT>& operator<<(ProElemIdType<ELEM_VALUE_TYPE_INT>& );
		  //PV_T<ELEM_VALUE_TYPE_WSTRING>& operator<<(ProElemIdType<ELEM_VALUE_TYPE_WSTRING>& );
		  
		  template<ProElemId id,ElemValueType VT>
		  PV_T<VT>& operator<<(ProElemIdType<id,VT>& );

		  PV():len(0)
		  {

		  }
		  PV_T_item* items[12];
		  int len;

		  ~PV();

	  };

	  class PV_T_item
	  {
	  public:
		  PV * pv;
	  };


	  template<ElemValueType VT>
	  class PV_T :public PV_T_item
	  {
	  public:
		  template<ProElemId id,ElemValueType VT>
		  PV_T<VT>& operator<<(ProElemIdType<id,VT>&  )
		  {
			  //int aa = v.value; 
			  PV_T<VT>* p = new PV_T<VT>();
			  pv->items[pv->len] = p;
			  pv->len += 1;
			  p->pv = pv;
			  return *p;
		  }
	  };

	  PV::~PV()
	  {
		  for (int i = 0 ; i < len ; i++)
		  {
			  delete items[i];
		  }
	  }

	  template<ProElemId id,ElemValueType VT>
	  PV_T<VT>& PV::operator<<(ProElemIdType<id,VT>& )
	  {
		  PV_T<VT>* p = new PV_T<VT>();
		  items[len] = p;
		  len++;
		  p->pv = this;
		  return *p;
	  }

	  template<ProElemId id,ElemValueType VT,ProElemId id2,ElemValueType VT2>
	  PV_T<VT2>& operator<<(ProElemIdType<id,VT>& ,ProElemIdType<id2,VT2>&)
	  {
		  PV_T<VT2>* p = new PV_T<VT2>();
		  return *p;
	  }

	  /*
	  PV_T<ELEM_VALUE_TYPE_INT>& PV::operator<<(ProElemIdType<ELEM_VALUE_TYPE_INT>& )
	  {
		  PV_T<ELEM_VALUE_TYPE_INT>* p = new PV_T<ELEM_VALUE_TYPE_INT>();
		  items[len] = p;
		  len++;
		  p->pv = this;
		  return *p;
	  }

	  PV_T<ELEM_VALUE_TYPE_WSTRING>& PV::operator<<(ProElemIdType<ELEM_VALUE_TYPE_WSTRING>& )
	  {
		  PV_T<ELEM_VALUE_TYPE_WSTRING>* p = new PV_T<ELEM_VALUE_TYPE_WSTRING>();
		  items[len] = p;
		  len++;
		  p->pv = this;
		  return *p;
	  }	*/

	  template <ProElemId id>
	  int GetValue(ProElement eletree,const ProElemIdType<id,ELEM_VALUE_TYPE_INT>&   )
	  {
		  return 0;
	  }

	  int GetValue(ProElement eletree,const PV_T<ELEM_VALUE_TYPE_INT>& path  )
	  {
		  return 0;
	  }
	  wchar_t* GetValue(ProElement eletree,const PV_T<ELEM_VALUE_TYPE_WSTRING>& path  )
	  {
		  return 0;
	  }

}
}